package com.example.demo.nyxcosmetics;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.http.Method;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.metadata.data.HyperlinkData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
import com.alibaba.excel.write.merge.LoopMergeStrategy;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.jetbrains.annotations.NotNull;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

@Slf4j
public class NyxcosmeticsExportor {
    private static final String COOKIES = "dwac_bcAKUiaagvSQUaaadlszBwMi11=Alihowrb7xJeneg-eWqxyClL14UqKPjmxPU%3D|dw-only|||USD|false|US%2FEastern|true; cqcid=acb3krplR9yX4V9JopaQVzXA84; cquid=||; dwanonymous_cc233482db11a3f09aa5acf398a34be8=acb3krplR9yX4V9JopaQVzXA84; sid=Alihowrb7xJeneg-eWqxyClL14UqKPjmxPU; __cq_dnt=0; dw_dnt=0; dwsid=OsiAwyGHIkzV_fm1HZMQexHb9uUBdDW4T5XQPDgiUBYO_stn13jVBMza0r5QgDC6BL-q5QqIGC1x0c_KdxTRHA==; modiface_vto_privacy=false; geo-redirect=true; dwpersonalization_cc233482db11a3f09aa5acf398a34be8=a534f695dc9e3b64966413076920241101070000000; gaFlags=ecs%3Aviewer; cf_clearance=LaV_mPKqCynSbGkLqini0.k9J4XGkoGooTwmhEJFlyw-1724852616-1.2.1.1-4_zFkz76q5zBI_sPGf8ORfw2H6Bz3PUDSOAM.TlsWvkoLZGnOdTW9DjA0qUHE99_Twu3kkygWS0X0yl6Kz0wN4GIz3CkvFEREPFg9M829L6fnWEzy6QCdtepTODZIEG1QhCI0dCrb3XyV.Jhc_EWoMpM0xXpnEr2jQ.rA7eRDkOjWjvKc9y_ssKWwCD3jsalozJeVfDLZtD8LR4kMcRd1hGZT4Zuquq_LdLWDaKywg5RA6lMFo7UAPkBr7S4YvS4lzIcb7M8LTiu.M6x1rsv_eb7dTwAHB1xpbfi9yuedRJ836sPCps3uxZIHzgbZDhAZEUzmckCcYx5OfDwOM1LYXk266U1N1mjojSy8hEVNC97OYkLrzBqlVkP3oYvLw22W0P0lNsbH_26R0ERoRP3rw; forterToken=4617c974b1e04724b996daa020f68bdf_1724852595725_1482_UAL9_9ck; __cf_bm=6dUdui2t416_Wkwd0s9K0VtXlTgqRDybjp0zkwfunFU-1724859669-1.0.1.1-qN3Vc9D.rpU1nFNz9rCjjwudAWk_4Gy3nBM3S2RRu7JbEACPtw0K7.JGmXQ7_GdXE3_yem4srogYoJUKKnQPiA; _cfuvid=BRK9yQ16sqedTLvMugIrOFGFLfbv6Nv7nw5Ve9jh7Vw-1724859669722-0.0.1.1-604800000; customer-info-reminder=1724859669577";

    private static final String ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36";
    private static final String Referer = "https://www.nyxcosmetics.com/best-sellers/";
    private static final String SEC_CH_UA = "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"\n";
    private static final String SEC_CH_UA_MOBILE = "?0";
    private static final String SEC_CH_UA_PLATFORM = "\"Windows\"";
    /*Sec-Fetch-Dest:empty
Sec-Fetch-Mode:navigate
Sec-Fetch-Site:same-origin*/
    private static final String SEC_FETCH_DEST = "empty";
    private static final String SEC_FETCH_MODE = "navigate";
    private static final String SEC_FETCH_SITE = "same-origin";

    private static final String root_path = "C:\\Users\\blysin\\Documents\\workspaces\\java\\demo\\src\\test\\java\\com\\example\\demo\\nyxcosmetics";

    @Test
    @SneakyThrows
    public void parseJson() {
        String path = root_path + "\\data\\MAKEUP-SALE-1.json";

        List<ExportDate> list = parseJSONData(path);

        System.out.println(list.size());
        System.out.println("--------------->" + JSON.toJSONString(list, JSONWriter.Feature.PrettyFormat));

        List<ExportDateExt> extList = list.stream()
                .flatMap(e -> MergeExportDataUtils.merge(e).stream())
                .collect(Collectors.toList());

        AbstractMergeStrategy loopMergeStrategy = new AbstractMergeStrategy() {
            @Override
            protected void merge(Sheet sheet, Cell cell, Head head, Integer integer) {
                int rowIndex = cell.getRowIndex();
                int columnIndex = cell.getColumnIndex();
//                sheet.merge
            }
        };

        String fileName = root_path + "\\export-single.xlsx";
        EasyExcel.write(fileName, ExportDateExt.class).sheet().doWrite(extList);
    }

    private @NotNull List<ExportDate> parseJSONData(String path) {
        JSONObject root = JSON.parseObject(FileUtil.readUtf8String(path));
        JSONArray elements = root.getJSONObject("searchgrid").getJSONArray("elements");
        List<ExportDate> list = elements.stream().map(e -> {
            JSONObject item = (JSONObject) e;
            JSONObject pid = item.getJSONObject("pid");

            JSONObject quickView = pid.getJSONObject("common/componentslist#product-tile-headlines-searchgrid");
            JSONArray viewItems = quickView.getJSONArray("items");


            JSONObject productPrice = pid.getJSONObject("product/productprice#producttile");

            ExportDate data = new ExportDate();

            JSONObject nameObj = (JSONObject) viewItems.get(0);
            JSONObject subNameObj = (JSONObject) viewItems.get(1);
            data.setName(nameObj.getJSONObject("data").getString("name"));
            data.setSubName(subNameObj.getJSONObject("data").getString("value"));
            data.setPrice(parsePrice(productPrice.getString("price"), BigDecimal.ZERO));
            data.setSalePrice(parsePrice(productPrice.getString("strikethroughPrice"), data.getPrice()));
            data.setImage(getHyperlink(parseImageUrl(pid.getString("productImage"))));


            JSONArray products = pid.getJSONObject("analytics").getJSONArray("products");

            List<ExportDate> productList = products.stream().map(p -> {
                JSONObject product = (JSONObject) p;
                return parseProduct(product);
            }).collect(Collectors.toList());
            data.setProducts(productList);
            return data;
        }).collect(Collectors.toList());
        return list;
    }

    private static BigDecimal parsePrice(String price, BigDecimal defaultValue) {
        if (StrUtil.isEmpty(price)) {
            return defaultValue;
        }
        //只保留数字
        String s = price.replaceAll("[^0-9.]", "");
        return new BigDecimal(s);
    }

    @Test
    @SneakyThrows
    public void exportData() {
        String folder = root_path + "\\data\\";
        File file = new File(folder);
        File[] jsonFiles = file.listFiles();
        if (jsonFiles == null) {
            return;
        }

        Arrays.sort(jsonFiles);


        Arrays.stream(jsonFiles).forEach(e -> System.out.println(e.getName()));

        Map<String, List<ExportDate>> map = new HashMap<>();
        Arrays.stream(jsonFiles).forEach(e -> {
            String name = e.getName();
            name = name.replace(".json", "");
            name = name.split("-")[0];
            List<ExportDate> list = parseJSONData(e.getAbsolutePath());
            List<ExportDate> datas = map.getOrDefault(name, new ArrayList<>());
            datas.addAll(list);
            map.put(name, datas);
        });
        map.forEach((key, value) -> System.out.println(key + "->" + value.size()));

        dpWriteExcel(map);
    }

    private void dpWriteExcel(Map<String, List<ExportDate>> map) {
        String fileName = root_path + "\\export.xlsx";
        //遍历map，每个key一个sheet
        File file = new File(fileName);
        if (file.exists()) {
            file.delete();
        }

//        printAllImages(map);

//        checkNotExistFile(map);

        // 这里 需要指定写用哪个class去写
        try (ExcelWriter excelWriter = EasyExcel.write(fileName, ExportDateExt.class).build()) {
            for (String key : map.keySet()) {
                List<ExportDate> list = map.get(key);

                List<ExportDateExt> extList = list.stream()
                        .flatMap(e -> MergeExportDataUtils.merge(e).stream())
                        .collect(Collectors.toList());

                extList.forEach(e -> {
                    WriteCellData<String> image = e.getImage();
                    if (image != null) {
                        String address = image.getHyperlinkData().getAddress();
                        File imagesFile = ParseFileNameUtils.exists(address);
                        e.setImageFile(imagesFile);
                    }
                    WriteCellData<String> productImage = e.getProduct_image();
                    if (productImage != null) {
                        String address = productImage.getHyperlinkData().getAddress();
                        File imagesFile = ParseFileNameUtils.exists(address);
                        e.setProduct_imageFile(imagesFile);
                    }
                });

                WriteSheet writeSheet = EasyExcel.writerSheet(key).build();
                excelWriter.write(extList, writeSheet);
            }
        }


    }

    private static void checkNotExistFile(Map<String, List<ExportDate>> map) {
        Set<String> notExistImages = new HashSet<>();

        for (String key : map.keySet()) {
            List<ExportDate> list = map.get(key);

            List<ExportDateExt> extList = list.stream()
                    .flatMap(e -> MergeExportDataUtils.merge(e).stream())
                    .collect(Collectors.toList());

            extList.forEach(e -> {
                WriteCellData<String> image = e.getImage();
                if (image != null) {
                    String address = image.getHyperlinkData().getAddress();
                    File imagesFile = ParseFileNameUtils.exists(address);
                    if (imagesFile == null) {
                        notExistImages.add(address);
                    }
                }
                WriteCellData<String> productImage = e.getProduct_image();
                if (productImage != null) {
                    String address = productImage.getHyperlinkData().getAddress();
                    File imagesFile = ParseFileNameUtils.exists(address);
                    if (imagesFile == null) {
                        notExistImages.add(address);
                    }
                }
            });

        }
        System.out.println("not exist images: " + JSON.toJSONString(notExistImages));
    }

    private static void printAllImages(Map<String, List<ExportDate>> map) {
        Set<String> images = new HashSet<>();
        for (String key : map.keySet()) {
            List<ExportDate> list = map.get(key);

            List<ExportDateExt> extList = list.stream()
                    .flatMap(e -> MergeExportDataUtils.merge(e).stream())
                    .collect(Collectors.toList());

            extList.forEach(e -> {
                WriteCellData<String> image = e.getImage();
                if (image != null) {
                    images.add(image.getHyperlinkData().getAddress());
                }
                WriteCellData<String> productImage = e.getProduct_image();
                if (productImage != null) {
                    images.add(productImage.getHyperlinkData().getAddress());
                }
            });

        }
        System.out.println(images.size());
        List<List<String>> split = CollectionUtil.split(images, 20);

        for (List<String> list : split) {
            System.out.println();
            System.out.println();
            System.out.println();
            System.out.println(CollectionUtil.join(list, ","));
            System.out.println();
            System.out.println();
            System.out.println();
            System.out.println("------------------------");
        }
    }

    @Test
    @SneakyThrows
    public void downloadImage() {
        String imgUrl = "https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw6958001d/ProductImages/2018/Lips/Lip_Lingerie_Gloss/800897155254_liplingeriegloss_clear_main.jpg";
        byte[] bytes = HttpUtil.downloadBytes(imgUrl);
        FileUtil.writeBytes(bytes, "C:\\Users\\blysin\\Documents\\workspaces\\java\\demo\\src\\test\\java\\com\\example\\demo\\nyxcosmetics\\temp.jpg");
    }

    @Test
    @SneakyThrows
    public void printStr() {
        String str = "  <a class=\"c-product-image c-product-image__link\" href=\"/pro-artistry/palettes/beetlejuice-color-for-the-recently-deceased-8-pan-color-palette/NYX_1110.html\" aria-label=\"\" data-js-product-image   >   <div class=\"c-product-image__carousel\"> <section class=\"c-carousel m-slidesperview-1 m-arrows-medium m-show-arrows-on-hover m-slidesperview-1 m-spacebetween-0\"  aria-label=\"Go to BEETLEJUICE COLOR FOR THE RECENTLY DECEASED 8-PAN COLOR PALETTE product details\"  role=\"region\" aria-roledescription=\"carousel\" data-component-container data-js-carousel-container data-component=\"global/Carousel\"  data-component-options=\"{&quot;classNames&quot;:{&quot;arrows&quot;:&quot;m-inside&quot;,&quot;nextArrow&quot;:&quot;js-productimage__arrow-next&quot;,&quot;prevArrow&quot;:&quot;js-productimage__arrow-prev&quot;,&quot;scrollbar&quot;:&quot;js-productimage__scrollbar&quot;,&quot;pagination&quot;:&quot;js-productimage__pagination&quot;},&quot;bulletMessage&quot;:&quot;Go to slide&quot;,&quot;a11y&quot;:{&quot;carouselItemAriaLabel&quot;:&quot;Slide {0} of {1}&quot;,&quot;autoplayAriaLabelStop&quot;:&quot;Stop slide rotation&quot;,&quot;autoplayAriaLabelPlay&quot;:&quot;Start slide rotation&quot;,&quot;prevSlideMessage&quot;:&quot;Previous slide&quot;,&quot;nextSlideMessage&quot;:&quot;Next slide&quot;,&quot;slideLabelMessage&quot;:&quot;{{index}} of {{slidesLength}}&quot;},&quot;initialSlide&quot;:0,&quot;title&quot;:&quot;Go to BEETLEJUICE COLOR FOR THE RECENTLY DECEASED 8-PAN COLOR PALETTE product details&quot;,&quot;showArrows&quot;:true,&quot;loop&quot;:false,&quot;showScrollbar&quot;:true,&quot;slidesPerView&quot;:1,&quot;spaceBetween&quot;:0,&quot;breakpoints&quot;:{&quot;medium down&quot;:{&quot;showArrows&quot;:false}}}\"> <div class=\"h-show-for-sr\" aria-live=\"polite\" aria-atomic=\"true\" data-js-carousel-aria></div> <div class=\"c-carousel__inner\" data-js-carousel>     <div class=\"c-carousel__content \" data-js-container  data-analytics=\"{&quot;promoObject&quot;:{&quot;creative&quot;:&quot;carousel&quot;},&quot;placement&quot;:&quot;others&quot;}\"  >  <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"     data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\"Color for the Recently Deceased Color Palette packshot open and closed pack\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw56c80495/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-PMU-Makeup-Eye-Palette-BJ-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-BJP01-0800897264802-OpenClosed.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"  aria-label=\"Slide 2 of 6\"   data-index=\"1\"    data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\"Beetlejuice Color for the Recently Deceased Color Palette benefits\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw8a621a86/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-BJP01-Complementary-Benefits.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"  aria-label=\"Slide 3 of 6\"   data-index=\"2\"    data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\"Beetlejuice Color For the Recently Deceased Color Palette Eye Macros\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dwd4db9273/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Application-Alyssa-Kayla-Nathalie.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"  aria-label=\"Slide 4 of 6\"   data-index=\"3\"    data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\" Beetlejuice Color for the Recently Deceased Color Palette armswatch\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw9fa24aa0/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Swatch-Abby-Kayla-Nathalie.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"  aria-label=\"Slide 5 of 6\"   data-index=\"4\"    data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\"Color For the Recently Deceased Color Palette Step by Step Education How to apply shadow\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw690e0f83/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/NYX-Professional-Makeup-COLOR-FOR-THE-RECENTLY-DECEASED-PALETTE-0800897264802-Tutorial-Alyssa.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   <div class=\"c-carousel__item \" data-js-carousel-item role=\"group\" aria-roledescription=\"slide\"  aria-label=\"Slide 6 of 6\"   data-index=\"5\"    data-analytics=\"{&quot;category&quot;:&quot;product selector page&quot;,&quot;action&quot;:&quot;select::carousel arrow::&quot;,&quot;label&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_arrow_selected&quot;,&quot;click_action&quot;:&quot;&quot;,&quot;product_info&quot;:&quot;beetlejuice color for the recently deceased 8-pan color palette::800897264802&quot;},&quot;swipeData&quot;:{&quot;action&quot;:&quot;select::carousel image::&quot;,&quot;extraData&quot;:{&quot;event_name&quot;:&quot;carousel_selected&quot;}}}\"  >     <img class=\"\" alt=\"BEETLEJUICE BEETLEJUICE campaign group visual\" src=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=193&sfrm=jpg&q=70\"  srcset=\"https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=97&sfrm=jpg&q=70 97w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=193&sfrm=jpg&q=70 193w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=290&sfrm=jpg&q=70 290w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=328&sfrm=jpg&q=70 328w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=386&sfrm=jpg&q=70 386w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=181&sfrm=jpg&q=70 181w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=253&sfrm=jpg&q=70 253w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=362&sfrm=jpg&q=70 362w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=543&sfrm=jpg&q=70 543w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=615&sfrm=jpg&q=70 615w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=724&sfrm=jpg&q=70 724w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=135&sfrm=jpg&q=70 135w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=189&sfrm=jpg&q=70 189w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=270&sfrm=jpg&q=70 270w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=405&sfrm=jpg&q=70 405w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=459&sfrm=jpg&q=70 459w, https://www.nyxcosmetics.com/dw/image/v2/AANG_PRD/on/demandware.static/-/Sites-cpd-nyxusa-master-catalog/default/dw3488ff51/ProductImages/2024/EYES/BJ-RECENTLY-DECEASED-PALETTE/202408XX-DMI-ATF-BEETLEJUICE-Collection-Model-Spokesmodel.jpg?sw=540&sfrm=jpg&q=70 540w\" sizes=\"(min-width:1024px) 270px, (min-width:768px) 362px, (min-width:0) 193px\" width=\"193\" data-aspectratio=\"auto\" />   </div>   </div>   <div class=\"c-carousel__arrows m-inside\" data-js-carousel-arrows> <button class=\"c-carousel__arrow-prev js-productimage__arrow-prev\" aria-label=\"Previous slide\" type=\"button\"></button> <button class=\"c-carousel__arrow-next js-productimage__arrow-next\" aria-label=\"Next slide\" type=\"button\"></button> </div>    <div class=\"c-carousel__scrollbar js-productimage__scrollbar \"></div>  </div>  </section>  </div>   </a>  ";
//        System.out.println(str);

        String imgUrl = parseImageUrl(str);
        System.out.println(imgUrl);
    }

    private static String parseImageUrl(String str) {
        String imgUrl = "";
        Document document = Jsoup.parse(str);
        Elements img = document.getElementsByTag("img");
        System.out.println(img.size());
        if (CollectionUtils.isNotEmpty(img)) {
            imgUrl = img.get(0).attr("src");
        }
        return imgUrl;
    }

    @SneakyThrows
    private static ExportDate parseProduct(JSONObject product) {
        ExportDate data = new ExportDate();
        data.setName(product.getString("name"));
        data.setSubName(product.getString("subname"));
        data.setCategory(product.getString("category"));
        data.setPrice(product.getBigDecimal("price"));
        data.setSalePrice(product.getBigDecimal("salePrice"));
        data.setCurrency(product.getString("currency"));
        data.setStock(product.getString("stock"));
//        data.setImage(new URL(product.getString("imgUrl")));
//        data.setImageUrl(product.getString("imgUrl"));
        String img = product.getString("imgUrl");


        // 设置超链接
        WriteCellData<String> hyperlink = getHyperlink(img);
        data.setImage(hyperlink);

        return data;
    }

    @NotNull
    private static WriteCellData<String> getHyperlink(String img) {
        WriteCellData<String> hyperlink = new WriteCellData<>("商品图片 - 点击查看");
        HyperlinkData hyperlinkData = new HyperlinkData();
        hyperlink.setHyperlinkData(hyperlinkData);
        hyperlinkData.setAddress(img);
        hyperlinkData.setHyperlinkType(HyperlinkData.HyperlinkType.URL);
        return hyperlink;
    }


    @Test
    @SneakyThrows
    public void testGetHttp() {
        JSONObject jsonObject = postList("lip-makeup", 1, 30);
        System.out.println(jsonObject);


    }

    private JSONObject postList(String type, int page, int size) {
        //跟据page和size计算start值
        int start = (page - 1) * size;
        String url = "https://www.nyxcosmetics.com/" + type + "/?start=" + start + "&sz=" + size + "&ajax=true";
        url = "https://www.nyxcosmetics.com/lip-makeup/?start=0&sz=36";
        log.info("请求地址:{}", url);
        HttpRequest request = HttpUtil.createRequest(Method.GET, url);
        request.cookie(COOKIES);
        request.header("User-Agent", ua);
        request.header("Referer", Referer);
        request.header("Sec-Ch-Ua", SEC_CH_UA);
        request.header("Sec-Ch-Ua-Mobile", SEC_CH_UA_MOBILE);
        request.header("Sec-Ch-Ua-Platform", SEC_CH_UA_PLATFORM);
        request.header("Sec-Fetch-Dest", SEC_FETCH_DEST);
        request.header("Sec-Fetch-Mode", SEC_FETCH_MODE);
        request.header("Sec-Fetch-Site", SEC_FETCH_SITE);
        request.header("Upgrade-Insecure-Requests", "1");
        String body = HttpUtil.get(url);
        if (!isJsonStr(body)) {
            log.error("body is not json str:{}", body);
            return null;
        }
        return JSONObject.parse(body);

    }

    private boolean isJsonStr(String string) {
        return (string.startsWith("{") && string.endsWith("}")) || (string.startsWith("[") && string.endsWith("]"));
    }
}
